<?php
namespace structure\components;

class Text extends \components\Component
{
	public function Start()
	{
		$component = $this->GetComponent();

		$attr = $component->GetAttribute('content');

		$content = (string)$component->GetContent();

		if (!empty($content))
		{
			return $content;
		}
		elseif (is_numeric($attr) && $component->GetAttribute('translate') == "true")
		{
			return core("I18n")->Translate($attr);
		}
		else
		{
			return $attr;
		}
	}
}